package com.itheima.api.calendar;

import java.util.Calendar;
import java.util.Scanner;

public class CalenderDemo2_2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个年份:");
        int year = sc.nextInt();

        Calendar cal = Calendar.getInstance();

        cal.set(Calendar.YEAR,year);

        cal.set(year , 2 , 1);

        cal.add(Calendar.DAY_OF_MONTH , -1);

        int day = cal.get(Calendar.DAY_OF_MONTH);
        System.out.println("day = " + day);
    }
}
